home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Trading on the Edge
/
Trading On The Edge - CD-ROM Toolkit (Wayzata Technology)(2031)(1994).bin
/
pc
/
mac_file
/
vendor_d
/
neuralwa
/
nw2v50
/
drsreinf.nnc
< prev
next >
Wrap
Text File
|
1993-08-23
|
2KB
|
64 lines
csv3.8 !file format is Control Strategy Version 3.8
! Aug 92 (drsreinf.nnc) Reinforcement learning
!************************************************************************
!* *
!* Directed Random Search Reinforcement *
!* *
!************************************************************************
!
!MASK label op-code operands comment
L_saR_sa trace aux3 ! set trace option to aux3
L_saR_sa optset op:reinf ! reinforcment learning
Li_aR_sa cset recall,0 ! recall count
!
! Recall/Test is standard feed-forward pass through the network
!
! Get input (reinf/test/recall mode only)
!
L___R_sa lset in ! input layer
L___R_sa io read ! get input data
!
! Do a forward pass through network through the network
! If there is no learn function this might be a projective layer
! and the sum MUST be split. Otherwise, it might be a cascaded layer
! and the sum must NOT be split
L___R_sa @rloop fcmp learnf,ll:none ! check out learn function
L___R_sa bne @nospl
L___R_sa math sum|fire
L___R_sa math rnoise|tran|output|fire
L___R_sa brct @nxtly
L___R_sa @nospl math sum|rnoise|tran|output|fire
L___R_sa @nxtly lset cur,1 ! next layer
L___R_sa lcmp out ! at output layer ?
L___R_sa blt @rloop ! loop till done
!
! Compute final output
!
L___R_sa math sum|tran|output|fire
!
! read in desired output (reinf/test mode only)
L___R_sa io rcltst ! get desired output (test)
L___R_sa math ce=e|e-=w|swap|fire ! Error for instruments
! Write out result
L___R_sa io write ! recall
!
!
! Learn: no input or output
!
! Call error function at output layer since in DRS
! further processing is needed to drive learning (as in DRS)
! Zero out individual errors since these are meaningless
! and may confuse
L_saR___ lset out ! output layer
L_saR___ math e-=w|e=0|fire !
!
! Now adjust weights for each layer in turn
L_saR___ lset in ! input layer
L_saR___ @lloop math learn|fire !
L_saR___ lset cur,1 ! next layer
L_saR___ lcmp out ! at output layer ?
L_saR___ blt @lloop ! loop till done
L_saR___ math learn|fire !
!
LisaRisa trace 0 ! turn off any trace function